package thread;

import thread.util.WebDownloaderUtil;

/**
 * demo3
 * 多线程下载网络图片
 *
 * @author dingwen
 * @date 2021/09/05
 */
public class Demo3 extends Thread {

    /**
     * url
     */
    private String url;
    /**
     * name
     */
    private String name;

    public Demo3(String url, String name) {
        this.url = url;
        this.name = name;
    }

    @Override
    public void run() {
        WebDownloaderUtil.downloader(url,name);
        System.out.println("下载了" + name + "的文件");
    }

    public static void main(String[] args) {
        Demo3 t1 = new Demo3("https://www.baidu.com/link?url=mdAf6qUc5dCTIwLD6Q3jKwmvMcs6CJn5rpEliOxb1B-Pgu34Am-3JXArS5gvLzD4WQcxNpkjnUs82u4-4QeXFglMhVnXJaMQT2D5f7shBaM5P1YlSy6T7n7gDm09saMO2r18Xx874j8MCpanE7RUI9e5ayrUytDgIvMIHs0kbNfDqLN_OTOcz7R3DkdCNs17dhv5nuFNaxvZcUydmYrNI0CkfCS7gr0J18cG52ybGY7G7id_qrozY6ge0X6zVGahnipw_otkqpNj7UW9Jxu1BCtjQhFTNR5oKUBJSk9-Q0X-GaxUd6gbxSdvHttGeilkyZINSs5pHwgLNjgF_cLmeJZzkRpWz0b90mxDxJKw0A3h7a_cDpwfPNxOBSV2lWFPRbr5ELC2ghRP7-7VBx17xiIPfLWvy8064oorvY1aAtdHprwtQWhvQIjmR3d8q4y1qevgdnNGhO6f7crGeODdiMJJBgw4BicsxqoXLiIW-Eg4iPzZlQ7R1AH_sTzR0BS6pm4Cy-Jy8aqZKjAyQCjW0t7JjqN1caYoOD0N1ymSU62K2mytfhqLmMDWde-AiJ1LAb14qUachbDAYRtTA3Nei_&wd=&eqid=8cae01e9000066230000000361343a02","1.jpg");
        Demo3 t2 = new Demo3("https://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=tupain&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&hd=undefined&latest=undefined&copyright=undefined&cs=67323756,518322526&os=2809338534,1082215187&simid=3123418117,3816291338&pn=25&rn=1&di=13640&ln=295&fr=&fmq=1630812709686_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=0&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%253A%252F%252Fdingyue.ws.126.net%252FMo%253DX4X4Fqvj4wcNACNAdR6VVDsPFblJ4oyKNgmcj60dR41554622336168.jpg%26refer%3Dhttp%253A%252F%252Fdingyue.ws.126.net%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1633404709%26t%3D155921677fb036dbeaba0e702e439475&rpstart=0&rpnum=0&adpicid=0&nojc=undefined","2.jpg");
        Demo3 t3 = new Demo3("https://image.baidu.com/search/detail?ct=503316480&z=undefined&tn=baiduimagedetail&ipn=d&word=tupain&step_word=&ie=utf-8&in=&cl=2&lm=-1&st=undefined&hd=1&latest=0&copyright=0&cs=2977941019,1842819723&os=2489967780,3193237028&simid=3446759049,228943532&pn=46&rn=1&di=9240&ln=295&fr=&fmq=1630812709686_R&fm=&ic=undefined&s=undefined&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&is=0,0&istype=0&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=10e&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%253A%252F%252Fimg2.liuxue360.com%252Fphoto%252F2016%252F05%252F21%252F20160521175959003.jpg%26refer%3Dhttp%253A%252F%252Fimg2.liuxue360.com%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Djpeg%3Fsec%3D1633404751%26t%3Dcf38a64223ccaf92b7617a9d5543a7eb&rpstart=0&rpnum=0&adpicid=0&nojc=undefined","3.jpg");

        t1.start();
        t2.start();
        t3.start();
        // 每次执行下载的顺序都不一样
    }
}


